//
//  ViewController.swift
//  YJAdvertisingDemo
//
//  Created by Jim1024 on 2017/2/13.
//  Copyright © 2017年 Jim1024. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.green
        title = "Home"
        
        NotificationCenter.default.addObserver(self, selector: #selector(jump2ADDetail), name: ADTapActionNotification, object: nil)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @objc fileprivate func jump2ADDetail() {
        let adVC = ADViewController()
        adVC.urlString = UserDefaults.standard.string(forKey: ADUrl)
        navigationController?.pushViewController(adVC, animated: true)
    }
    
    deinit {
        NotificationCenter.default.removeObserver(self)
    }

}

